import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/home',
    name:'home',
    component:()=> import('../views/Home.vue'),
  },{
    path:'/bao',
    name:'bao',
    component:()=>import('../views/Baobao.vue'),
    children:[{
      path:'/bao/list1',
      name:'baolist1',
      component:()=>import('../views/Baolist/baobaoList.vue'),
    },{
      path:'/bao/list2',
      name:'baolist2',
      component:()=>import('../views/Baolist/baobaoList2.vue'),
    },{
      path:'/bao',
      redirect:'/bao/list1'
    }
  ]
  },{
    path:'/order',
    name:'order',
    component:()=>import('../views/Order.vue'),
  },{
    path:'/mine',
    name:'mine',
    component:()=>import('../views/Mine.vue'),
  },{
    path:'/',
    redirect:'/home'
  },{
    path:'*',
    component:()=>import('../views/NotFound.vue')
  }
  
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
